<template>
  <RouterView />
</template>

<script lang="ts" setup>
const mode = import.meta.env.VUE_MODE
if (mode === 'dev') {
  // 测试环境token
  const token =
    'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJsb2dpbk5hbWUiOiJmZW5nd2VuIiwiZXhwIjoxNzExMTU5NDQ2fQ.8wbY7RK29taohb_Ljg0XjnZiEebOX9qEnA1j9eRsfRo'
  const expirationDate = new Date(Date.now() + 24 * 60 * 60 * 7) // 设置为一周后过期
  document.cookie =
    'X-Access-Token=' + token + '; expires=' + expirationDate.toUTCString() + '; path=/'
}
</script>
